@import "../../abstracts/variables";
@import "../../abstracts/mixins";

/**
 * <select> primary color, borders, icons, etcetera...
 */
$color: set-color(grey, light);
$default-border: (1px solid shade($color, 20%));

.nacho-select {
  display: flex;
  align-items: center;
  height: 34px;
  width: 100%;
  max-width: 300px;
  border: $default-border;
  border-radius: 2px;
  background-color: set-color(white, base);
  padding: 0 14px;

  select {
    @include prefix(appearance, none, ('webkit', 'moz'));

    &::-ms-expand {
      display: none;
    }

    outline: none;
    border: 0;
    border-radius: 2px;
    background-color: transparent;
    width: 100%;
    height: 100%;

    &:disabled {
      cursor: not-allowed;
      color: shade($color, 10%);

      &:after {
        visibility: hidden;
      }
    }
  }

  &:after {
    color: shade($color, 20%);
    content: '\e259';
    font-weight: normal;
    pointer-events: none;
    font-family: $glyphicons-stack;
  }

  /// Hides the styling for a select element unless hovered over
  &--hidden-state {
    border: 1px solid transparent;
    background-color: transparent;

    &:hover {
      border: $default-border;

      &::after {
        visibility: visible;
      }
    }

    &::after {
      visibility: hidden;
    }
  }
}
